﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using PlatWL.Data;
using PlatWL.Services.Tools;

namespace PlatWL.Services.Services
{
    public class AdminManage
    {
        public void GetList(ref Msg_Result msg, int Client,Msg_Page page)
        {
            //Expression<Func<PT_User_Account, bool>> where;

            int total = 0;
            msg.result = new pt_auth_userb().GetEntities(null, (w => w.CRTime), "desc", page.pageindex, page.pagesize, out total);
            msg.total = total;

        }

        public void GetModel(ref Msg_Result msg,int Client, int ID)
        {
            msg.result = new pt_auth_userb().GetEntity(d => d.ID == ID);
        }
        public void AddModel(ref Msg_Result msg, int Client, pt_auth_user adv)
        {
            bool result = false;
            if (adv.ID == 0)
            {
                //adv.Client = Client;
                //adv.CRTime = DateTime.Now;
                //result = new PT_User_AccountB().Insert(adv);
            }
            else
            {
                result = new pt_auth_userb().Update(adv);
            }
            if (!result)
            {
                msg.error = "更新失败";
            }
        }

    }
}
